import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.util.List;

public class SinglyLinkedList2Test {
    SinglyLinkedList2 list = new SinglyLinkedList2();
    @Test
    public void test1(){
        list.addFront(1);
        list.addFront(2);
        list.addFront(3);
        list.addFront(4);
        list.loop(value->{
            System.out.println(value);
        });
    }
    @Test
    public void test2(){
        list.addFront(1);
        list.addFront(2);
        list.addFront(3);
        list.addFront(4);
        for (Integer value : list) {
            System.out.println(value);
        }
    }
    @Test
    public void test3(){
        list.addLast(1);
        list.addLast(2);
        list.addLast(3);
        list.addLast(4);
        Assertions.assertIterableEquals(List.of(1,2,3,4),list);
    }
    @Test
    public void test4(){
        list.addLast(1);
        list.addLast(2);
        list.addLast(3);
        list.addLast(4);
        int i =list.get(2);
        System.out.println(i);
    }
    @Test
    public void test5(){
        list.addLast(1);
        list.addLast(2);
        list.addLast(3);
        list.addLast(4);
       list.insert(1,5);
        for (Integer value : list) {
            System.out.println(value);
        }
    }
    @Test
    public void test6(){
        list.addLast(1);
        list.addLast(2);
        list.addLast(3);
        list.addLast(4);
        list.remove(3);
        Assertions.assertIterableEquals(List.of(1,2,3),list);
    }
}
